home *** CD-ROM | disk | FTP | other *** search
- This modeled closely after getcmt.c ( from snippets ). Main
- differences include:
-
- 1) This correctly parses strings, and doesn't (incorrectly) take an open
- comment token in a string to signal the beginning of a comment.
-
- 2) It prints an error message if it finds a close comment without an
- open comment preceding it.
-
- 3) Use of DOS wildcards to specify file-names.
-
- 4) It will look for files with the following extensions if none is
- specified: .c, .cpp, .cxx, .cc, ,.h, .hpp, .hxx. I believe this will
- accomodate the naming conventions of most c and c++ compilers, but more
- are easily added if needed.
-
- 5) As you might expect from the mention of c++ above, this recognizes
- c++ style comments as well as normal C comments.
-
- Switch characters: Upper or lower case. Unrecognized options will print
- a short help message.
-
- You can specify an output file for the comments to be printed on in
- either of two ways:
- a) -e.ext Specify a new extension to be appended to the base name
- of the file being looked at. eg. get_cmt -e.cmt lexyy.c would append
- the text of the comments in lexyy.c to lexyy.cmt.
- b) -ofilename will place all the comments from all files examined in
- the file named. eg. get_cmt -ocomments lexyy.c would append the comments
- contained in lexyy.c to the file named comments, if it existed. If it
- doesn't exist, it will be created. If both -e and -o are specified, -e
- takes precedence.
-
- -l places line-numbers on which comments were found before each
- comment printed.
-
- In case anyone doesn't have access to lex/flex/whatever to translate
- the .l file to c, I've included the source code ready for compilation.
- As far as I know, it is reasonably ( more than reasonably, actually )
- portable and should compile under most DOS or Unix C compilers without
- problems. It's been tested with Borland c++ 2.0, Microsoft Quick C, and
- GNU C 1.39. Some compilers ( Borland's in particular ) will complain
- about unreacable code, but otherwise, this compiles quite cleanly.
-
- This program was written in Dec. 1991 by Jerry Coffin. The actual
- lex source code is public domain. The C code inluded, as well as the
- executable, are derived works of GNU, because I used flex in producing
- them. ( I think that makes them derived works, in the case of flex,
- since it embeds source code from it's skeleton file into the program it
- produces. If this is incorrect, anyone is free to correct me. )
- Assuming they are derived works, you are required to provide source code
- if you re-distribute them. On the othe hand, if you start with the
- original source code, and produce a new lexyy.c ( or whatever ) with a
- lex without the restrictions placed on flex output, you are more than
- welcome to do what you will with your program. The executable was
- produced with Borland C++ 2.0, and contains portions that are copyright
- Borland International. To provide credit where due, I should point out
- that this is based on a program by originally by Greg Messer ( Byte
- Magic Software ) and modified by Bob Stout. I'm deeply indebted to
- both of them.
-
- Unabashed commercial message follows. Please ignore it, if it might
- offend you.
-
- By the way, I'm presently working at Taco Bell. If you happen to be
- impressed by the programming of this, or anything else I've written,
- please feel free to bring my name up as likely being available for
- programming positions you know of being available. Thank You.
-
- And now back to our regurlarly scheduled programming.
-
- I hope you find this program enjoyable, informative or useful, or
- best of all, all of the above. If wish to find fault with it, please
- feel free to contact the author, Jerry Coffin, on the FidoNet C_echo, or
- any where else you can find him. As I write this ( Jan. 1992 ) I
- frequent several interenational echos on FidoNet. With a little luck,
- this program may actually be useful enough that it will still be in use
- when some portion of the above stuff becomes obselete.
- Later,
- Jerry.
-